package Structural.Proxy.aop.SpringAOP;

import Structural.Proxy.aop.SpringAOP.impl.TestServiceImpl;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.EnableAspectJAutoProxy;
import org.springframework.context.annotation.Primary;

@Configuration
@EnableAspectJAutoProxy
@ComponentScan
public class LogAspectConfig {

    @Bean
    public TestService setTestService() {
        TestServiceImpl ts = new TestServiceImpl();
        return ts;
    }

//    @Bean
//    public LogAspect logAspect() {
//        return new LogAspect();
//    }

    @Bean
    @Primary
    public LogAspect logAspect2() {
        return new LogAspect();
    }

}

